package com.zhongkai.model3;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * 设备异常记录表
 */
@Entity
@Table(name = "unlike",  catalog = "")
public class Unlike implements Serializable {
    private Long id;
    private Long solveTime;//异常发生时间
    private String warCause;//异常原因
    private String warCode;//异常原因
    private String userName;//用户姓名
    private String userPhone;//用户手机号
    private String address;//设备地址
    private String userUuid;//用户uuid
    private String unitUuid;//设备uuid


    @Basic
    @Column(name = "war_code")
    public String getWarCode() {
        return warCode;
    }

    public void setWarCode(String warCode) {
        this.warCode = warCode;
    }

    @Basic
    @Column(name = "user_uuid")
    public String getUserUuid() {
        return userUuid;
    }

    public void setUserUuid(String userUuid) {
        this.userUuid = userUuid;
    }


    @Basic
    @Column(name = "unit_uuid")
    public String getUnitUuid() {
        return unitUuid;
    }

    public void setUnitUuid(String unitUuid) {
        this.unitUuid = unitUuid;
    }

    @Id
    @GenericGenerator(name = "generator", strategy = "increment")
    @GeneratedValue(generator = "generator")
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }


    @Basic
    @Column(name = "solve_time")
    public Long getSolveTime() {
        return solveTime;
    }

    public void setSolveTime(Long solveTime) {
        this.solveTime = solveTime;
    }


    @Basic
    @Column(name = "war_cause")
    public String getWarCause() {
        return warCause;
    }

    public void setWarCause(String warCause) {
        this.warCause = warCause;
    }

    @Basic
    @Column(name = "user_name")
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    @Basic
    @Column(name = "user_phone")
    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    @Basic
    @Column(name = "address")
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Unlike unlike = (Unlike) o;
        return Objects.equals(id, unlike.id) &&
                Objects.equals(solveTime, unlike.solveTime) &&
                Objects.equals(warCause, unlike.warCause) &&
                Objects.equals(userName, unlike.userName) &&
                Objects.equals(userPhone, unlike.userPhone) &&
                Objects.equals(address, unlike.address);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, solveTime, warCause, userName, userPhone, address);
    }
}
